package com.scheuk.euler;

public class p006 {

	/* Find the difference between the sum of the squares of the first one hundred 
	 * natural numbers and the square of the sum. (1-100)
	 * 
	 * Example: Difference between the sum of the squares of the first ten 
	 * natural numbers (1-10 and the square of the sum is 3025-385 = 2640.
	 */
	static void Problem6(int value) {
		int sumOfSquares = 0, squareOfSum = 0;
		for (int i = value; i > 0; i--) {
			sumOfSquares += i*i;
			squareOfSum+=i;
		}
		int temp = squareOfSum;
		squareOfSum = temp*temp;
		System.out.println("sum of squares: " + sumOfSquares);
		System.out.println("square of sum: " + squareOfSum);
		System.out.println("difference: " + (squareOfSum - sumOfSquares));
	}

}
